<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>个人信息修改</title>
	<link rel="stylesheet" href="js/jquery-ui/themes/base/all.css">
	<style>
		.u{
			width: 100%;
			border-collapse: collapse;
			font-family:楷体;
			font-size:18px;
		}
		.u td{
			border:solid 1px #ccc;
			height:30px;
			border:0;
		}
	</style>
	<script src="js/jquery.js"></script>
	<script src="js/jquery-ui/jquery-ui.js"></script>
	<script src="js/jquery-ui/ui/i18n/datepicker-zh-CN.js"></script>
	<script>
		$(function(){
			$("#birthday").datepicker({
				changeYear:true,
				changeMonth:true
			});
		});
		
		$(function(){
			$("#workYear").datepicker({
				changeYear:true,
				changeMonth:true
			});
		});
	
		function changeCountryName(){
			var countryName = $(":selected").html();
			$("#countryName").val(countryName);
		}
	</script>
</head>
<body>
	<form action="updateInfo.do" method="post">
	<table class="u" >
		<tr>
			<td>姓名</td>
			<td><input type="text" name="regName" value="${sessionScope.userInfo.regName }"></td>
		</tr>
		<tr>
			<td>email</td>
			<td><input type="text" name="email" value="${sessionScope.userInfo.email }"></td>
		</tr>
		<tr>
			<td>生日</td>
			<td><input id="birthday" type="text" name="birthday" value='<f:formatDate value="${sessionScope.userInfo.birthday }" pattern="yyyy-MM-dd"/>'></td>
		</tr>
		<tr>
			<td>国家</td>
			<td><input id="countryName" type="hidden" name="coutry.name" value="${userInfo.country.name }">
				<select name="country.countryId" id="countryId" onchange="changeCountryName()">
				<c:forEach items="${countryList}" var="c">
				<c:choose>
					<c:when test="${c.countryId==userInfo.country.countryId }">
						<option value="${c.countryId }" selected>${c.name}</option>
					</c:when>
					<c:otherwise>
						<option value="${c.countryId }">${c.name}</option>
					</c:otherwise>
				</c:choose>
				</c:forEach>			
									
				</select>
			</td>
		</tr>
		<tr>
			<td>真实姓名</td>
			<td><input type="text" name="realName" value="${sessionScope.userInfo.realName }"></td>
		</tr>
		<tr>
			<td>性别</td>
			<td><input type="text" name="sex" value="${sessionScope.userInfo.sex }"></td>
		</tr>
		<tr>
			<td>地址</td>
			<td><input type="text" name="address" value="${sessionScope.userInfo.address }"></td>
		</tr>
		<tr>
			<td>手机号码</td>
			<td><input type="text" name="mobilephone" value="${sessionScope.userInfo.mobilephone }"></td>
		</tr>
		<tr>
			<td>学历</td>
			<td><input type="text" name="education" value="${sessionScope.userInfo.education }"></td>
		</tr>
		<tr>
			<td>兴趣爱好</td>
			<td><input type="text" name="interesting" value="${sessionScope.userInfo.interesting }"></td>
		</tr>
		<tr>
			<td>工作日期</td>
			<td><input id="workYear" type="text" name="workYear" value='<f:formatDate value="${sessionScope.userInfo.workYear }" pattern="yyyy-MM-dd"/>'></td>
		</tr>
	</table>
	${msg }
	<input type="submit" value="保存修改">
	</form>
	
</body>
</html>